<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>物流托运</title>
    <link rel="stylesheet" href="<?php echo IMG_PATH ?>bdkd/css/reset.css">
    <link rel="stylesheet" href="<?php echo IMG_PATH ?>bdkd/css/wu_scss.css?saasd=2">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link href="apple-touch-icon.png" rel="apple-touch-icon">
    <link href="<?php echo IMG_PATH ?>bdkd/css/wu_style.css" rel="stylesheet">
    <link href="https://cdn.bootcss.com/framework7/1.6.5/css/framework7.ios.min.css" rel="stylesheet">
    <link href="https://cdn.bootcss.com/framework7/1.6.5/css/framework7.ios.colors.min.css" rel="stylesheet">
    <script src="<?php echo IMG_PATH ?>bdkd/js/jquery-1.11.1.min.js"></script>
    <script src="<?php echo IMG_PATH ?>bdkd/js/flexible.js"></script>
    <style>
        *{
            a:active{
                text-decoration:none;
            }
            a:link{
                text-decoration:none;
            }
            a:visited{
                text-decoration:none;
            }
            a:hover{
                text-decoration:none;
            }
        }
    </style>
</head>
<body>
    <nav>
        <a><div onclick="sendgood()"><span>寄快递</span></div></a>
        <a><div onclick="qu()"><span>取快递</span></div></a>
        <a><div onclick="wu()"><span>物流托运</span></div></a>
        <div class="gongneng">
            <p>功能</p>
            <img src="<?php echo IMG_PATH ?>bdkd/img/xiala@2x.png" alt="">
            <div class="kuaidigongsi" style="display:none";>
                <ul>
                    <a><div onclick="price()"><li>价格查询</li></div></a>
                    <a><div onclick="time()"><li>时效查询</li></div></a>
                    <a><div onclick="jx()"><li>禁寄物品</li></div></a>
                    <a><div onclick="sm()"><li>免责声明</li></div></a>
                </ul>
            </div>
        </div>
    </nav>
    <div class="yihangzi">
        <p><span>*</span> 托运物品须30-200公斤，超过请直接联系便递平台。</p>
    </div>
    <input type="hidden" name="num" value="<?php
    if(!empty($num)){
        echo $num;
    }
    //echo $num;
    ?>">
    <a onclick="swu()" class="fajianren">
        <div class="yuan">
            <div class="dian"></div>
        </div>
        <input type="hidden" name="gsmz" id="gsmz" value="" >
        <input type="hidden" name="sname" id="sname1" value="" >
        <div class="fajianrenxinxi">
            <input type="text" class="rjx-fajianren rjx-fjr1" placeholder="发货人信息" value="" readonly="readonly" >
            <textarea name="text" placeholder="请输入详细的发货人信息,以便我们更好地完成您的需要" value="" readonly="readonly" class="rjx-fjrxx"></textarea>
        </div>
    </a>
<!--    <a onclick="window.open('../dizhi1/dizhi.html?wu=2')" class="shoujianren">-->
    <a onclick="gwu()" class="shoujianren">
        <div class="yuan-one">
            <div class="dian-one"></div>
        </div>
        <input type="hidden" name="gname" id="gname1" value="" >
        <input type="hidden" name="gphone" id="gphone1" value="" >
        <div class="shoujianrenxinxi">
            <input type="text" value="" placeholder="收货人信息" readonly="readonly" class="rjx-sjr1">
            <textarea name="text" class="rjx-sjrxx" placeholder="请输入详细的收货人信息,以便我们更好地完成您的需要" value="" readonly="readonly"></textarea>
        </div>
    </a>

    <div class="phone jjsj" style="border:none;" style="z-index:0;">
            <!-- <span>寄件时间</span>
            <span>9:00-10:00<img src="./img/fanhui@2x.png" alt=""></span> -->
            <div class="views" style="width:100%;">
                <div class="list-block" style="margin:20px 0;">
                    <ul>
                        <li>
                            <div class="item-content">
                                <div class="item-inner" style="padding-right:0px;">
                                    <div class="item-title label" style="font-size: 14px">
                                    托运时间
                                        <font class="color-red"></font>
                                    </div>
                                    <div class="item-input">
                                        <input type="text" placeholder="9:00-10:00" readonly id="location" name="location">
                                    </div>
                                    <img src="<?php echo IMG_PATH ?>bdkd/img/fanhui@2x.png" alt="" class="fanhui">
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
            <script src="<?php echo IMG_PATH ?>bdkd/js/wu_jquery.min.js"></script>
            <script src="<?php echo IMG_PATH ?>bdkd/js/wu_framework7.min.js"></script>
            <script src="<?php echo IMG_PATH ?>bdkd/js/wu_regionsObject2.js"></script>
            <script src="<?php echo IMG_PATH ?>bdkd/js/wu_cityPicker.js"></script>
    </div>
    <div class="duiwomen">
        <div class="xiangshuode">
            <p><span>*</span>请输入想对我们说的...</p>
            <p>物品 : <input class="wupin" type="text" placeholder="请描述您的托运物品" value=""></p>
            <p>需求 : <input class="xuqiu" type="text" placeholder="请输入您的需求（可不填）" value=""></p>
        </div>
    </div>
    <div class="xuanze">
        <div class="wuliugongsi">
            <p>选择物流公司</p>
            <div class="rjx-wlgs"><span><img class="rjx-t-bug" src="<?php echo IMG_PATH ?>bdkd/img/yhq@2x.png" alt="">德邦物流</span><span><img class="rjx-t-bug" src="<?php echo IMG_PATH ?>bdkd/img/yhq@2x.png" alt="">百世物流</span></div>
        </div>
    </div>
    <div class="fuwuxieyi">
        <div class="anniu">
            <span>
                <img class="danxuan-btn" src="<?php echo IMG_PATH ?>bdkd/img/yhq@2x.png" alt="">
            </span>

            <span>我已阅读并同意</span>
            <a onclick="xy()">《便递服务协议》</a>
        </div>
        <div class="btn" onclick="send()">开始托运</div>
    </div>
    <input class="xyzt" name="xyzt" type="hidden" value="">
    <input class="suibian" type="hidden" name="suibian" value="">
    <script type="text/javascript">
        var clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
        $(window).on('resize', function () {
            var nowClientHeight = document.documentElement.clientHeight || document.body.clientHeight;
            if (clientHeight > nowClientHeight) {
                $('body').css('margin-top','-150px').css('transition','all 0.3s ease 0s');
                $('.wenben-xsd').css('color','#333');
            }
            else {
                $('body').css('margin-top','0px').css('transition','all 0.3s ease 0s');
                $('.wenben-xsd').css('color','#333');
            }
        });
        function jx() {
            window.location.href = '<?php echo SITE_PATH ?>work/bpost/jx';
        }
        function sm() {
            window.location.href = '<?php echo SITE_PATH ?>work/bpost/sm';
        }
        function price() {
            window.location.href = '<?php echo SITE_PATH ?>work/bexpress/price';
        }
        function time() {
            window.location.href = '<?php echo SITE_PATH ?>work/bexpress/time';
        }
        function xy() {
            window.location.href = '<?php echo SITE_PATH ?>work/bpost/jxy';
        }

        function send(){
            var i = $('.xyzt').val();
            if(i==0){
                alert('请阅读并同意《便递服务协议》');
                return false;
            }
            var sname=$(" input[ name='sname' ] ").val();
            var sphone=$(" input[ name='sphone' ] ").val();
            var gname=$(" input[ name='gname' ] ").val();
            var gphone=$(" input[ name='gphone' ] ").val();
            var saddress=$("#saddress").val();
            var gaddress=$("#gaddress").val();

            var wupin=$(".wupin").val();
            var xuqiu=$(".xuqiu").val();

            var remark=wupin+xuqiu;

            //选择托运公司
            var express_type= $(".suibian").val();
            //console.log(express_type);

            var time=$(" input[ name='location' ] ").val();


            $.ajax({
                url:"<?php echo SITE_PATH ?>work/bexpress/logistics",
                type:"post",
                data:{
                    'sname': sname,
                    'sphone': sphone,
                    'gname': gname,
                    'gphone': gphone,
                    'saddress': saddress,
                    'gaddress': gaddress,
                    'time' : time,
                    'express_type': express_type,
                    'remark' : remark,
                },
                success: function(data){
                    console.log(data);
                    if(data.result==1){
                        alert('提交成功!');
                    }else {
                        alert(data.msg);
                    }
                },
                error: function(){
                    alert('提交失败0!');
                }
//                async:"false";
            })
        }


        $('.gongneng').click(function(){
            var bianliang=$(".kuaidigongsi").css("display");
            if(bianliang==="none"){
                $('.kuaidigongsi').css('display','block');
            }else{
                $('.kuaidigongsi').css('display','none');
            }

        });
        $.each($(".kuaidigongsi ul li"),function(index,item){
            $(item).click(function(){
                $(".kuaidigongsi ul li").removeClass("custom_bg");
                $(this).addClass("custom_bg");
            });
        });
        $('.wenben-xsd').focus(function(){
            $('.wenben-xsd').css('color','#333');
        })
        $('.wupin').focus(function(){
            $('.wupin').css('color','#333');
        })
        $('.xuqiu').focus(function(){
            $('.xuqiu').css('color','#333');
        })
        /*点击按钮切换*/
        var custom_num=0;

        $('.danxuan-btn').click(function(){
            var custom_src=$(this).attr("src");
            var newSrc=custom_src==='<?php echo IMG_PATH ?>bdkd/img/yhq@2x.png'?'<?php echo IMG_PATH ?>bdkd/img/yhq1@2x.png':'<?php echo IMG_PATH ?>bdkd/img/yhq@2x.png';
            console.log(newSrc);
            $(this).attr('src',newSrc);
            custom_num=custom_num===0?1:0;
            console.log(custom_num);
            $(".xyzt").val(custom_num);
            console.log($('.xyzt').val());
        });
        function custom_huantu2(ele){
            var tupian1 = $(ele).attr("src");
            $(".rjx-wlgs span img").each(function(index,item){
                $(item).attr("src","<?php echo IMG_PATH ?>bdkd/img/yhq@2x.png");
            });
            var newSrc = tupian1 === '<?php echo IMG_PATH ?>bdkd/img/yhq@2x.png'?'<?php echo IMG_PATH ?>/bdkd/img/yhq1@2x.png':'<?php echo IMG_PATH ?>/bdkd/img/yhq@2x.png';
            $(ele).attr("src",newSrc);
        }

        $(".rjx-wlgs span img").each(function(index,item){
            console.log(item);
            $(item).click(function(){
                custom_huantu2(this);
                var suibian =index+5;
//                console.log(typeof suibian);
                $('.suibian').val(suibian);


            });
        })
        /*点击按钮切换*/
        var oU=document.querySelector(".rjx-sjr1");
        var foU=document.querySelector(".rjx-fjr1");
        var oU2=document.querySelector(".rjx-sjrxx");
        var foU2=document.querySelector(".rjx-fjrxx");
        var g=localStorage;
        var fcanshu = $(" input[ name='num' ] ").val();
        /**/
        if(fcanshu==4){

            var fstr="";
            var fn=g.getItem('fname');
            var fd=g.getItem('fdianhua');
            fstr+=fn+fd;
            foU.value=fstr;
            foU.style.color='#333';
            var f ="";
            var fx=g.getItem('fxinxi');
            var fxxxx=g.getItem('fxxxx');
            f+=fxxxx+fx;
            foU2.innerHTML=f;
            foU2.style.color='#333';

            var str="";
            var n=g.getItem('name');
            var d=g.getItem('dianhua');
            $('#gname1').val(n);
            $('#gphone1').val(d);
            str+=n+d;
            oU.value=str;
            oU.style.color='#333';
            var s = "";
            var x=g.getItem('xinxi');
            var xxxx=g.getItem('xxxx');
            s+=x+xxxx;
            oU2.innerHTML=s;
            oU2.style.color='#333';

            $('#sname1').val(fn);
            $('#sphone1').val(fd);
            $('#gname1').val(n);
            $('#gphone1').val(d);
        }else if(fcanshu==3){
            var fstr="";
            var fn=g.getItem('fRjxName1');
            var fd=g.getItem('fRjxDianhua1');
            fstr+=fn+fd;
            foU.value=fstr;
            foU.style.color='#333';
            var f ="";
            var fx=g.getItem('fRjxDizhi1');
            f+=fx;
            foU2.innerHTML=f;
            foU2.style.color='#333';

            var str="";
            var n=g.getItem('sRjxName2');
            var d=g.getItem('sRjxDianhua2');
            str+=n+d;
            oU.value=str;
            oU.style.color='#333';
            var s = "";
            var x=g.getItem('sRjxDizhi2');
            s+=x;
            oU2.innerHTML=s;
            oU2.style.color='#333';
            $('#sname1').val(fn);
            $('#sphone1').val(fd);
            $('#gname1').val(n);
            $('#gphone1').val(d);
        }

        var gname='';
        var gphone='';
        gname+=fn;
        gphone+=fd;
        $('#rjx-fajianren').val(gname);
        $('#rjx-fajianren1').val(gphone);
        var qname='';
        var qphone='';
        qname+=n;
        qphone+=d;
        $('#rjx-sjianren').val(qname);
        $('#rjx-sjianren1').val(qphone);






        //state 1从发件人跳到地址页  2从收件人跳到地址页
        function swu() {
            window.location.href = '<?php echo SITE_PATH ?>work/bexpress/sendwu?state=1';
        }

        function gwu() {
            window.location.href = '<?php echo SITE_PATH ?>work/bexpress/sendwu?state=2';
        }

        function sendgood() {
            window.location.href = '<?php echo SITE_PATH ?>work/bexpress/index';
        }
        function qu() {
            window.location.href = '<?php echo SITE_PATH ?>work/bexpress/qu';
        }
        function wu(){
            window.location.href = '<?php echo SITE_PATH ?>work/bexpress/wu';
        }

    </script>
</body>
</html>